package db

const TableNameGameUser = TablePrefix + "game_user"

type GameUser struct {
	BaseModel
	GameID     uint  `gorm:"column:game_id;type:int(11);default:0;comment:游戏id" json:"game_id" form:"game_id"`             // 游戏id
	UID        uint  `gorm:"column:uid;type:int(11);default:0;comment:用户id" json:"uid" form:"uid"`                         // 用户id
	RoleID     uint  `gorm:"column:role_id;type:int(11);default:0;comment:角色id" json:"role_id" form:"role_id"`             // 角色id
	Champion   int64 `gorm:"column:champion;type:int(11);default:0;comment:冠军场次" json:"champion" form:"champion"`          // 冠军场次
	Runner     int64 `gorm:"column:runner;type:int(11);default:0;comment:亚军场次" json:"runner" form:"runner"`                // 亚军场次
	ThirdPlace int64 `gorm:"column:third_place;type:int(11);default:0;comment:季军场次" json:"third_place" form:"third_place"` // 季军场次
	Total      int64 `gorm:"column:total;type:int(11);default:0;comment:总场次" json:"total" form:"total"`                    // 总场次
	Integral   int64 `gorm:"column:integral;type:int(11);default:0;comment:积分" json:"integral" form:"integral"`            // 积分
}

func (*GameUser) TableName() string {
	return TableNameGameUser
}

type GameUserHasOneRolePoolOfSkill struct {
	GameUser
	Role GameRolePoolHasOneSkill `gorm:"foreignKey:ID;references:RoleID" json:"role"`
}
